﻿using System.Collections.Generic;

namespace PARCS.Core
{
    /// <summary>
    /// Contains all information needed for running AM
    /// </summary>
    public class AMInfo
    {
        /// <summary>
        /// Current Task
        /// </summary>
        public Task CurrentTask { get; private set; }

        /// <summary>
        /// Channel to the parent point
        /// </summary>
        public Channel Parent { get; private set; }

        /// <summary>
        /// All channels from this point, without parent
        /// </summary>
        public List<Channel> Channels { get; private set; }

        /// <summary>
        /// Info about this point
        /// </summary>
        public Dictionary<object, object> Data { get; private set; }

        public AMInfo(Task currentTask = null, Channel parent = null, List<Channel> channels = null, Dictionary<object, object> data = null)
        {
            CurrentTask = currentTask;
            Parent = parent;
            Channels = channels;
            Data = data;
        }  

        public Point CreatePoint()
        {
            return Parent == null ? CurrentTask.CreatePoint(0) : CurrentTask.CreatePoint(Parent.From);
        }
    }
}
